﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Web;
using System.Web.Mvc;

namespace Minion.Web.Main.Controllers
{
    public class TaskController : Controller
    {
        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult SendEmail(string to, string message)
        {
            var subject = "Message from Minion";
            var mail = new MailMessage("noreply@norton.com", to, subject, message);
            var smtpClient = new SmtpClient();
            smtpClient.Send(mail);
            return new HttpStatusCodeResult(HttpStatusCode.Found);
        }
        
    }
}
